<?php
namespace app\admin\controller;
use think\Controller;
use think\Db;
use app\common\lib\Dir;
use app\common\lib\Curl;
class Attachment extends Common {
	
	public function index(){
		$data = [
			"source" => 'xw',
			"weather_type"=> 'observe|alarm|air|forecast_1h|forecast_24h|index|limit|tips|rise',
			"province"=> "北京",
			"city"=> "北京"
		];
		$c = (new Curl())->post("https://wis.qq.com/weather/common",$data);
		// p($c);die();
		$d = json_decode($c,true);
		// p($d);die;
		return show(1, '删除成功', $d['data'], 200);
		$data = request()->param();
		$url = isset($data['url']) ? $data['url']:'uploads';
		p($url);
		$data = Dir::tree($url);
		// p($data);
		$this->assign('files',$data);
		return $this->fetch();
	}
	public function attachment_list(){
		$data = Dir::tree('uploads');
		return showTable(0, 'OK',100, $data, 200);
	}
}
